package com.niiwoo.civet.user.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum TCFromTypeEnum {
    UNKNOW( 0, "未知"),
    TUAN_DAI( 1, "团贷网"),
    HAO_BANG_DAI( 2, "好帮贷"),
    PLATFORM_NIIWOO( 3, "你我金融"),
    HOUSE_BABY( 4, "房宝宝"),
    CASHCAR( 5, "现金动车"),
    QUANT_GROUP( 6, "量化派"),
    BORROW_FAST( 7, "借钱快"),
    RONG_360( 8, "融360"),
    CARD_NIU( 9, "卡牛"),;

    private Integer value;
    private String desc;

    /**
     * 通过RegisterChannel映射对应的TCFromTypeEnum
     *
     * @param registerChannel
     * @return
     */
    public static Integer getTCFromTypeFromRegisterChannel(UserEnum.RegisterChannel registerChannel) {
        TCFromTypeEnum fromTypeEnum;
        if (registerChannel == null) {
            return TCFromTypeEnum.UNKNOW.getValue();
        }
        switch (registerChannel) {
            case PLATFORM_APP_IOS:
                fromTypeEnum = TCFromTypeEnum.PLATFORM_NIIWOO;
                break;
            case PLATFORM_APP_ANDROID:
                fromTypeEnum = TCFromTypeEnum.PLATFORM_NIIWOO;
                break;
            case PLATFORM_H5:
                fromTypeEnum = TCFromTypeEnum.PLATFORM_NIIWOO;
                break;
            case LAN_LING_JIE:
                fromTypeEnum = TCFromTypeEnum.PLATFORM_NIIWOO;
                break;
            case RONG_360:
                fromTypeEnum = TCFromTypeEnum.RONG_360;
                break;
            case TUAN_DAI:
                fromTypeEnum = TCFromTypeEnum.TUAN_DAI;
                break;
            case HAO_BANG_DAI:
                fromTypeEnum = TCFromTypeEnum.HAO_BANG_DAI;
                break;
            case HOUSE_BABY:
                fromTypeEnum = TCFromTypeEnum.HOUSE_BABY;
                break;
            case QUANT_GROUP:
                fromTypeEnum = TCFromTypeEnum.QUANT_GROUP;
                break;
            case BORROW_FAST:
                fromTypeEnum = TCFromTypeEnum.BORROW_FAST;
                break;
            case CARD_NIU:
                fromTypeEnum = TCFromTypeEnum.CARD_NIU;
                break;
            default:
                fromTypeEnum = TCFromTypeEnum.UNKNOW;
                break;
        }
        return fromTypeEnum.getValue();
    }

}
